package com.sys.goods.pojo;


import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.sys.common.pojo.BasePojo;


/**
 * 商品表
 * @author lby
 *
 */
public class AGoods extends BasePojo<AGoods>
{
	private int goodsId;
	private int blindBoxId;
	private String goodsName;
	private double goodsPrices;
	private String goodsIntroduce;
	private String goodsPicture;
	private int goodsQuantity;
	private String commodityBrand;
	private Date shelfTime;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	
	private String statusStr;
	
	/* 关联关系 */
	private ABlindbox blindbox;
	
	/*
	 * 方便枚举项在网页上显示出来 键为值(数字), 值为字符串描述 只提供get方法
	 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		AGoodsEnum[] agoodsenum = AGoodsEnum.values();
		for (int i = 0; i < agoodsenum.length; i++)
		{
			AGoodsEnum agoodsEnum = agoodsenum[i];
			String key = agoodsEnum.toString();
			enumsMap.put(key + "-" + agoodsEnum.getStatus() + "", agoodsEnum.getName());
		}
		return enumsMap;
	}
	
	public String getStatusStr()
	{
		AGoodsEnum[] values = AGoodsEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AGoodsEnum goodsEnumTemp = values[i];
			if (goodsEnumTemp.toString().startsWith("STATUS"))
			{
				if (goodsEnumTemp.getStatus() == this.status)
				{
					this.statusStr = goodsEnumTemp.getName();
				}
			}
		}

		return statusStr;
	}
	
	
	
	
	public int getGoodsId()
	{
		return goodsId;
	}
	public void setGoodsId(int goodsId)
	{
		this.goodsId = goodsId;
	}
	public int getBlindBoxId()
	{
		return blindBoxId;
	}
	public void setBlindBoxId(int blindBoxId)
	{
		this.blindBoxId = blindBoxId;
	}
	public String getGoodsName()
	{
		return goodsName;
	}
	public void setGoodsName(String goodsName)
	{
		this.goodsName = goodsName;
	}
	public double getGoodsPrices()
	{
		return goodsPrices;
	}
	public void setGoodsPrices(double goodsPrices)
	{
		this.goodsPrices = goodsPrices;
	}
	public String getGoodsIntroduce()
	{
		return goodsIntroduce;
	}
	public void setGoodsIntroduce(String goodsIntroduce)
	{
		this.goodsIntroduce = goodsIntroduce;
	}
	public String getGoodsPicture()
	{
		return goodsPicture;
	}
	public void setGoodsPicture(String goodsPicture)
	{
		this.goodsPicture = goodsPicture;
	}
	public int getGoodsQuantity()
	{
		return goodsQuantity;
	}
	public void setGoodsQuantity(int goodsQuantity)
	{
		this.goodsQuantity = goodsQuantity;
	}
	public String getCommodityBrand()
	{
		return commodityBrand;
	}
	public void setCommodityBrand(String commodityBrand)
	{
		this.commodityBrand = commodityBrand;
	}
	public Date getShelfTime()
	{
		return shelfTime;
	}
	public void setShelfTime(Date shelfTime)
	{
		this.shelfTime = shelfTime;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getUpdateTime()
	{
		return updateTime;
	}
	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}
	public Date getPubTime()
	{
		return pubTime;
	}
	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public ABlindbox getBlindbox()
	{
		return blindbox;
	}

	public void setBlindbox(ABlindbox blindbox)
	{
		this.blindbox = blindbox;
	}
}
